<!DOCTYPE html>
<html lang="en">
<head>
    <title>疾病自测</title>
    <%- include('../../_global/baseLibs') %>
    <script type="text/javascript" src="/static/lib/util.js"></script>
</head>
<body>

<section class="page-wrap page-health">
    <header id="header" class="header-box grey fixed header-box">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0)"><i class="iconfont icon-back"></i></a>
            </div>
            <div class="title">疾病列表</div>
        </div>
    </header>
    <aside class="plane-box first">
        <ul class="default-list" id="list">


        </ul>
    </aside>
</section>
</body>
<script type="text/html" id="item">
    <li>
        <a onclick="">
            <div class="item-inner"><div class="item-content"></div>
                <div class="item-after">
                    <i class="iconfont icon-more"></i>
                </div>
            </div>
        </a>
    </li>
</script>
<script type="text/javascript">
    var page_diseaseList = (function($, page_diseaseList) {
        var uri_service_getDiseaseList = '/api/gzd/disease/getDiseaseList';

        function itemClickHandler(){

            var data = $(this).data("data");
            var item='disease_info_id='+data.disease_info_id;
            $.pageSwitch.goToUrl("diseaseTest","diseaseDetail",item );

        }

        function getList(){
            var part_name = $.QuickUrlUtils.getRequest('part_name');
            $.QuickRemote.AjaxJson({
                funcName: uri_service_getDiseaseList
                , params: {part_name: part_name}
                , callback: function (result) {
                    $.each(result, function(index, item){
                        var dis_item = page_diseaseList.createItem(item);
                        $("#list").append(dis_item);
                    })
                }
            });

        }

        function createItem(data){
            var item = $($("#item").html());
            item.find(".item-content").text(data['disease_name']);
            item.data("data", data);
            return item;
        }
        var cfg_def = {
            itemClickHandler: itemClickHandler,
            getList: getList,
            createItem: createItem,
        }

        page_diseaseList.init = function(cfg){
            $.extend(page_diseaseList, cfg_def, cfg);
            page_diseaseList.getList();

            $("#list").on("click", 'li', page_diseaseList.itemClickHandler);

        }

        return page_diseaseList;
    })(jQuery, {});
    



</script>

</html>